package com.yuke.cloud.service.smc.dao;

import com.yuke.cloud.common.core.mybatis.MyMapper;
import com.yuke.cloud.service.api.smc.dto.GoodsAndSpecInfoDto;
import com.yuke.cloud.service.api.smc.dto.ShopCartInfoDto;
import com.yuke.cloud.service.smc.dto.GoodsDto;
import com.yuke.cloud.service.smc.dto.GoodsInfoDto;
import com.yuke.cloud.service.smc.entity.ShopGoods;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface ShopGoodsMapper extends MyMapper<ShopGoods> {
    void updateGoodsPrice(@Param("shopGoodsId") Long shopGoodsId,@Param("salePrice") Integer salePrice);
    void goodsIsAlive(@Param("shopGoodsIds") List<Long> shopGoodsIds, @Param("isAlive") Integer isAlive);
    void addGoods(ShopGoods shopGoods);
    List<ShopGoods> getListByCondition(@Param("shopGoods") ShopGoods shopGoods);

//    List<GoodsDto> getGoodsBySpecIdAndDis(@Param("specId") Long specId, @Param("longitude") BigDecimal longitude, @Param("latitude") BigDecimal latitude, @Param("deliverDistance") Integer deliverDistance);
    List<GoodsDto> getGoodsBySpecIdAndDis(@Param("specId") Long specId, @Param("longitude") BigDecimal longitude, @Param("latitude") BigDecimal latitude);
    List<GoodsDto> getGoodsBySpecId(Long specId);
    List<GoodsDto> getGoodsByShopId(Long shopId);
    List<ShopGoods> getIsAliveStockGoodsByShopId(Long shopId);
    List<GoodsInfoDto> getGoodsInfo(@Param("search") String search, @Param("shopId") Long shopId);
    List<GoodsDto> getGoodsInfoByShopAndSpec(@Param("shopIds") List<Long> shopIds, @Param("specIds") List<Long> specIds);
    List<ShopGoods> getStockGoodsByShopIdAndSpecIds(@Param("shopId") Long shopId, @Param("specIds") List<Long> specIds, @Param("isAlive") Integer isAlive);
    List<ShopGoods> getStockGoodsByCondition(@Param("shopGoods") ShopGoods shopGoods, @Param("specIds") List<Long> specIds);
    //api
    Integer updateStockCount(@Param("shopId") Long shopId, @Param("specId") Long specId, @Param("goodsNum") Integer goodsNum);
    Byte getGoodsStatus(@Param("shopId") Long shopId, @Param("specId") Long specId);
    Integer getLowPriceBySpecId(Long specId);
    List<GoodsAndSpecInfoDto> getShopGoodsSalePrice(@Param("specIds") List<Long> specIds, @Param("longitude") BigDecimal longitude, @Param("latitude") BigDecimal latitude, @Param("deliverDistance") Integer deliverDistance);
}